package com.example.demo.common.lbsgeo.pubsub;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;

/**订阅客户端
 * Created by li on 2016/4/16.
 */
public class SubClient {
    private Jedis jedis;

    public SubClient(String host,int port){
        jedis = new Jedis(host,port);
    }

    public SubClient(Jedis jedis){
        this.jedis=jedis;
    }

    public void sub(JedisPubSub listener, String channel){
        jedis.subscribe(listener, channel);
    }
}
